package com.ftg.learn;

import dev.langchain4j.data.message.ChatMessage;
import dev.langchain4j.data.message.UserMessage;
import dev.langchain4j.model.chat.ChatModel;
import dev.langchain4j.service.AiServices;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 布衣
 */
@RestController
public class DemoController {

    @Resource
    LiftInterface c;
//    ChatModel chatLanguageModel;

    @GetMapping("/chat")
    public String chat(@RequestParam("question") String question) {
//        LiftInterface c = AiServices.builder(LiftInterface.class)
//                .chatModel(chatLanguageModel)
//                .build();
        return c.chat( question);
    }
}
